import request from '@/auth/request.js'
// import qs from 'qs'

export const userApi = {
  demo: process.env.VUE_APP_PROXY_API + '/auth/password',
  login: process.env.VUE_APP_PROXY_API + '/api/auth/password/login',
  logout: process.env.VUE_APP_PROXY_API + '/api/auth/logout',
  userMenus: process.env.VUE_APP_PROXY_API + '/api/user/menus',
  userInfo: process.env.VUE_APP_PROXY_API + '/api/user/menus'
}

// API demo
export function apiDemo () {
  const data = { username: 'hello', password: '123456' }
  return request.post(userApi.demo, data)
}

// 用户登录
export function apiLogin (data) {
  return request.post(userApi.login, data)
}

// 用户退出
export function apiLogout (data) {
  return request.post(userApi.logout, data)
}

// 获取用户菜单
export function apiGetUserMenus (data) {
  return request.post(userApi.userMenus, data)
}

// 获取用户信息
export function apiGetUserInfo (data) {
  return request.post(userApi.userInfo, data)
}
